/*
 * @Date: 2020-07-12 08:18:31
 * @LastEditors: zhiqinfff
 * @LastEditTime: 2020-07-16 23:43:41
 * @FilePath: /mobileProject/src/axios/api.js
 */ 
//api.js
import service from './request'

// 获取商品信息
export const getDataListApi = data => {
    return service({
        url: '/api/goods/find?show=1',
        method: 'get',
        data
    })
};

// 提交申请信息
export const submitgoodsApi = data => {
    return service({
        url: '/api/order/getgoods',
        method: 'post',
        data
    })
};

// 获取套餐列表
export const getSetMealListApi = data => {
    return service({
        url: '/api/setmeal/find?show=1',
        method: 'get',
        data
    })
};

// 获取首页长图和二维码
export const getBackgroundImgApi = data => {
    return service({
        url: '/api/config/find',
        method: 'get',
        data
    })
};

export const getOpenid = params => {
  return service({
    url: '/api/users/openid',
    method: 'get',
    params
  })
};

export const getCode = data => {
  return service({
    url: '/api/users/getcode',
    method: 'get',
    data
  })
};

// 提交订单
export const submitPaymentApi = data => {
    return service({
        url: '/api/order/order',
        method: 'post',
        data
    })
}
// h5支付
export const payByMWEB = data => {
    return service({
        url: '/api/order/payByMweb',
        method: 'post',
        data
    })
}

export const paySuccess = data => {
    return service({
        url: '/api/order/success',
        method: 'post',
        data
    })
}
export const findOrderById = params => {
    return service({
        url: '/api/order/find',
        method: 'get',
        params
    })
}

export const getShareConfig = data => {
    return service({
        url: '/api/users/getconfig',
        method: 'post',
        data
    })
}
